<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: doc/tutorials/content/sources/iccv2011/include/filters.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('iccv2011_2include_2filters_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">filters.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef FILTERS_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define FILTERS_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;pcl/filters/passthrough.h&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;pcl/filters/voxel_grid.h&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;pcl/filters/radius_outlier_removal.h&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160; </div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;typedefs.h&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">/* Use a PassThrough filter to remove points with depth values that are too large or too small */</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;PointCloudPtr</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;thresholdDepth (<span class="keyword">const</span> PointCloudPtr &amp; input, <span class="keywordtype">float</span> min_depth, <span class="keywordtype">float</span> max_depth)</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;{</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;  <a class="code" href="classpcl_1_1_pass_through.html">pcl::PassThrough&lt;PointT&gt;</a> pass_through;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;  pass_through.<a class="code" href="classpcl_1_1_p_c_l_base.html#a1952d7101f3942bac3b69ed55c1ca7ea">setInputCloud</a> (input);</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;  pass_through.<a class="code" href="classpcl_1_1_pass_through.html#a48d1b20e1039a3f6bd77d4dc78895f71">setFilterFieldName</a> (<span class="stringliteral">&quot;z&quot;</span>);</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;  pass_through.<a class="code" href="classpcl_1_1_pass_through.html#a4c852c876b5ed3d9235d5b4e59353883">setFilterLimits</a> (min_depth, max_depth);</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;  PointCloudPtr thresholded (<span class="keyword">new</span> <a class="code" href="classpcl_1_1_point_cloud.html">PointCloud</a>);</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  pass_through.filter (*thresholded);</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;  <span class="keywordflow">return</span> (thresholded);</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;}</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">/* Use a VoxelGrid filter to reduce the number of points */</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;PointCloudPtr</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;downsample (<span class="keyword">const</span> PointCloudPtr &amp; input, <span class="keywordtype">float</span> leaf_size)</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;{</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <a class="code" href="classpcl_1_1_voxel_grid.html">pcl::VoxelGrid&lt;PointT&gt;</a> voxel_grid;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  voxel_grid.<a class="code" href="classpcl_1_1_p_c_l_base.html#a1952d7101f3942bac3b69ed55c1ca7ea">setInputCloud</a> (input);</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;  voxel_grid.<a class="code" href="classpcl_1_1_voxel_grid.html#aa5d7831e665977bdce76ed05bd0005cf">setLeafSize</a> (leaf_size, leaf_size, leaf_size);</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  PointCloudPtr downsampled (<span class="keyword">new</span> <a class="code" href="classpcl_1_1_point_cloud.html">PointCloud</a>);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;  voxel_grid.<a class="code" href="classpcl_1_1_filter.html#a17115897ca28f6b12950d023958aa641">filter</a> (*downsampled);</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;  <span class="keywordflow">return</span> (downsampled);</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;}</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment">/* Use a RadiusOutlierRemoval filter to remove all points with too few local neighbors */</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;PointCloudPtr</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;removeOutliers (<span class="keyword">const</span> PointCloudPtr &amp; input, <span class="keywordtype">float</span> radius, <span class="keywordtype">int</span> min_neighbors)</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;{</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  <a class="code" href="classpcl_1_1_radius_outlier_removal.html">pcl::RadiusOutlierRemoval&lt;pcl::PointXYZRGB&gt;</a> radius_outlier_removal;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;  radius_outlier_removal.<a class="code" href="classpcl_1_1_p_c_l_base.html#a1952d7101f3942bac3b69ed55c1ca7ea">setInputCloud</a> (input);</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  radius_outlier_removal.<a class="code" href="classpcl_1_1_radius_outlier_removal.html#a822cc2303b1dab3bdd77e84fc1af3a5b">setRadiusSearch</a> (radius);</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  radius_outlier_removal.<a class="code" href="classpcl_1_1_radius_outlier_removal.html#a4c7da1a0e17e78cbe9667583b2eadaef">setMinNeighborsInRadius</a> (min_neighbors);</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;  PointCloudPtr inliers (<span class="keyword">new</span> <a class="code" href="classpcl_1_1_point_cloud.html">PointCloud</a>);</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;  radius_outlier_removal.filter (*inliers);</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <span class="keywordflow">return</span> (inliers);</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;}</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">/* Apply a series of filters (threshold depth, downsample, and remove outliers) */</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;PointCloudPtr</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;applyFilters (<span class="keyword">const</span> PointCloudPtr &amp; input, <span class="keywordtype">float</span> min_depth, <span class="keywordtype">float</span> max_depth, <span class="keywordtype">float</span> leaf_size, <span class="keywordtype">float</span> radius, </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;              <span class="keywordtype">float</span> min_neighbors)</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;{</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  PointCloudPtr filtered;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  filtered = thresholdDepth (input, min_depth, max_depth);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;  filtered = downsample (filtered, leaf_size);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  filtered = removeOutliers (filtered, radius, min_neighbors);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  <span class="keywordflow">return</span> (filtered);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;}</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclasspcl_1_1_filter_html_a17115897ca28f6b12950d023958aa641"><div class="ttname"><a href="classpcl_1_1_filter.html#a17115897ca28f6b12950d023958aa641">pcl::Filter::filter</a></div><div class="ttdeci">void filter(PointCloud &amp;output)</div><div class="ttdoc">Calls the filtering method and returns the filtered dataset in output.</div><div class="ttdef"><b>Definition:</b> filter.h:132</div></div>
<div class="ttc" id="aclasspcl_1_1_p_c_l_base_html_a1952d7101f3942bac3b69ed55c1ca7ea"><div class="ttname"><a href="classpcl_1_1_p_c_l_base.html#a1952d7101f3942bac3b69ed55c1ca7ea">pcl::PCLBase::setInputCloud</a></div><div class="ttdeci">virtual void setInputCloud(const PointCloudConstPtr &amp;cloud)</div><div class="ttdoc">Provide a pointer to the input dataset</div><div class="ttdef"><b>Definition:</b> pcl_base.hpp:66</div></div>
<div class="ttc" id="aclasspcl_1_1_pass_through_html"><div class="ttname"><a href="classpcl_1_1_pass_through.html">pcl::PassThrough</a></div><div class="ttdoc">PassThrough passes points in a cloud based on constraints for one particular field of the point type.</div><div class="ttdef"><b>Definition:</b> passthrough.h:81</div></div>
<div class="ttc" id="aclasspcl_1_1_pass_through_html_a48d1b20e1039a3f6bd77d4dc78895f71"><div class="ttname"><a href="classpcl_1_1_pass_through.html#a48d1b20e1039a3f6bd77d4dc78895f71">pcl::PassThrough::setFilterFieldName</a></div><div class="ttdeci">void setFilterFieldName(const std::string &amp;field_name)</div><div class="ttdoc">Provide the name of the field to be used for filtering data.</div><div class="ttdef"><b>Definition:</b> passthrough.h:111</div></div>
<div class="ttc" id="aclasspcl_1_1_pass_through_html_a4c852c876b5ed3d9235d5b4e59353883"><div class="ttname"><a href="classpcl_1_1_pass_through.html#a4c852c876b5ed3d9235d5b4e59353883">pcl::PassThrough::setFilterLimits</a></div><div class="ttdeci">void setFilterLimits(const float &amp;limit_min, const float &amp;limit_max)</div><div class="ttdoc">Set the numerical limits for the field for filtering data.</div><div class="ttdef"><b>Definition:</b> passthrough.h:131</div></div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html"><div class="ttname"><a href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a></div><div class="ttdoc">PointCloud represents the base class in PCL for storing collections of 3D points.</div><div class="ttdef"><b>Definition:</b> point_cloud.h:173</div></div>
<div class="ttc" id="aclasspcl_1_1_radius_outlier_removal_html"><div class="ttname"><a href="classpcl_1_1_radius_outlier_removal.html">pcl::RadiusOutlierRemoval</a></div><div class="ttdoc">RadiusOutlierRemoval filters points in a cloud based on the number of neighbors they have.</div><div class="ttdef"><b>Definition:</b> radius_outlier_removal.h:73</div></div>
<div class="ttc" id="aclasspcl_1_1_radius_outlier_removal_html_a4c7da1a0e17e78cbe9667583b2eadaef"><div class="ttname"><a href="classpcl_1_1_radius_outlier_removal.html#a4c7da1a0e17e78cbe9667583b2eadaef">pcl::RadiusOutlierRemoval::setMinNeighborsInRadius</a></div><div class="ttdeci">void setMinNeighborsInRadius(int min_pts)</div><div class="ttdoc">Set the number of neighbors that need to be present in order to be classified as an inlier.</div><div class="ttdef"><b>Definition:</b> radius_outlier_removal.h:126</div></div>
<div class="ttc" id="aclasspcl_1_1_radius_outlier_removal_html_a822cc2303b1dab3bdd77e84fc1af3a5b"><div class="ttname"><a href="classpcl_1_1_radius_outlier_removal.html#a822cc2303b1dab3bdd77e84fc1af3a5b">pcl::RadiusOutlierRemoval::setRadiusSearch</a></div><div class="ttdeci">void setRadiusSearch(double radius)</div><div class="ttdoc">Set the radius of the sphere that will determine which points are neighbors.</div><div class="ttdef"><b>Definition:</b> radius_outlier_removal.h:104</div></div>
<div class="ttc" id="aclasspcl_1_1_voxel_grid_html"><div class="ttname"><a href="classpcl_1_1_voxel_grid.html">pcl::VoxelGrid</a></div><div class="ttdoc">VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data.</div><div class="ttdef"><b>Definition:</b> voxel_grid.h:179</div></div>
<div class="ttc" id="aclasspcl_1_1_voxel_grid_html_aa5d7831e665977bdce76ed05bd0005cf"><div class="ttname"><a href="classpcl_1_1_voxel_grid.html#aa5d7831e665977bdce76ed05bd0005cf">pcl::VoxelGrid::setLeafSize</a></div><div class="ttdeci">void setLeafSize(const Eigen::Vector4f &amp;leaf_size)</div><div class="ttdoc">Set the voxel grid leaf size.</div><div class="ttdef"><b>Definition:</b> voxel_grid.h:223</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_e68e8157741866f444e17edd764ebbae.html">doc</a></li><li class="navelem"><a class="el" href="dir_5b0b179e83013be2ae877b5cea1eb6e2.html">tutorials</a></li><li class="navelem"><a class="el" href="dir_e680b2aa8c25f53365b84c58875b1c5f.html">content</a></li><li class="navelem"><a class="el" href="dir_532239a1d34197dad6a28d101a9d1eb1.html">sources</a></li><li class="navelem"><a class="el" href="dir_72091b6be856e2c48ba392fbb6348f26.html">iccv2011</a></li><li class="navelem"><a class="el" href="dir_23d34f47c6e88aa653f014de7cd4575b.html">include</a></li><li class="navelem"><b>filters.h</b></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
